<!-- 订单列表 -->

<!-- 项目管理 -->
<template>
  <div class="page-box h100 display-flex czbj">
    <p class="title-label mb10">米兔订单列表</p>
    <!-- sonRouter="yybureauFormationBJ" 为跳转新的页面编辑 -->
    <dxtable
      :dataJson="dataJson"
      :portUrl="portUrl"
      :formJson="formJson"
      :qx="qx"
      ref="databale"
    ></dxtable>
  </div>
</template>
<script lang="ts" setup>
import dxtable from "../../components/util/dxtable.vue";
import sort from "../../components/util/sort.vue";
import { dxget, dxpost } from "../../util/index";
import { NButton, NImage, NTag } from "naive-ui";
import { h, ref, reactive } from "vue";
const databale = ref();
const initeer = () => {
  databale.value.initDataExpose();
};
const jxcxzc = [
  {
    label: "制作中",
    value: 1,
  },
  {
    label: "制作完成 ",
    value: 2,
  },
  {
    label: "制作失败",
    value: "3",
  },
];
let dataJson = [
  {
    title: "订单编号",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "orderNumber",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  // {
  //   title: "主题id",
  //   type: "input",
  //   val: "",
  //   icon: "dx-shurukuang",
  //   span: 12,
  //   key: "theme",
  //   width: "",
  //   search: false,
  //   istable: true,
  //   required: false,
  // },
  // {
  //   title: "形象id",
  //   type: "input",
  //   val: "",
  //   icon: "dx-shurukuang",
  //   span: 12,
  //   key: "figureId",
  //   width: "",
  //   search: false,
  //   istable: true,
  //   required: false,
  // },

  {
    title: "造型图片",
    type: "img",
    val: "",
    icon: "dx-img",
    span: 24,
    key: "modelling",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "形象图片",
    type: "imglist",
    val: "",
    icon: "dx-img",
    span: 24,
    key: "imgList",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "金额",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "money",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "状态",
    type: "radio",
    icon: "dx-radiobox",
    val: "",
    render: (row) => {
      return jxcxzc.filter((a) => a.value == row.state)[0].label;
    },
  },
  //   {
  //     title: "排序",
  //     width: 100,
  //     render: (row) => {
  //       row.sjk = "xtgx"; //数据库
  //       row.databaseName = "keyEnterprise"; //表名
  //       return h(sort, {
  //         row,
  //         onCallBack: () => {
  //           initeer();
  //         },
  //       });
  //     },
  //   },
  {
    title: "下单时间",
    key: "addTime",
    width: 150,
  },
  {
    title: "审核时间",
    key: "shTime",
    width: 150,
  },
  {
    title: "制作时间",
    key: "zzTime",
    width: 150,
  },
];

const qx = {
  DeletePermissionID: "riceRabbitorderListdel", //删除
  EditPermissionIdentifier: "riceRabbitorderListbj", // 编辑
  NewPermissionIdentifier: "riceRabbitorderListxz22", // 新建
  ViewPermissionID: "riceRabbitorderListck", // 查看
};
const portUrl = "riceRabbit/orderList";

let formJson = reactive([
  {
    title: "订单编号",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 24,
    key: "orderNumber",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "造型图片",
    type: "img",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "modelling",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "状态",
    type: "radio",
    icon: "dx-radiobox",
    val: "",
    opt: [
      {
        label: "制作中",
        value: 1,
      },
      {
        label: "制作完成 ",
        value: 2,
      },
      {
        label: "制作失败",
        value: 3,
      },
    ],
    span: 12,
    key: "state",
    width: "",
    search: false,
    istable: true,
    required: false,
    callBack: (data) => {
      if (data == 3) {
        formJson[3].hide = false;
      } else {
        formJson[3].hide = true;
      }
    },
  },
  {
    title: "失败原因",
    type: "textarea",
    val: "",
    icon: "dx-duohangwenben",
    span: 24,
    key: "reason",
    width: "",
    search: false,
    istable: true,
    required: false,
    hide: true,
  },
]);
const czFun = {
  fun: (row) => {
    return [
      h(
        NButton,
        {
          type: "info",
          quaternary: true,
          onClick: async (e) => {},
        },
        "复制代码"
      ),
    ];
  },
};

// 获取字典内容
// const xtgxxmfl = async () => {
//   const { data }: any = await dxget("dxgjAdmin/getzd", { name: 'xtgxxmfl' })
//   dataJson[2].options = [
//     {
//       label: "全部",
//       value: ""
//     },
//     ...data
//   ]
//   formJson[2].options = data
//   xmlxSelect.value = data
//   console.log(data);
// }
// xtgxxmfl()
</script>
<style scoped></style>
